*  FILE NAME: INVBC.PRG
*  BY: NURJADI PURNAMA
*  DATE: May 30, 1996
*  DESC:
*  CALLED BY:
*  DATA FILES:
set deli oFF
DR='N:'
F1='DRUG_ENT'
F2='DISP_ENT'
SELE 1
SET EXCLU OFF
USE &DR&F1
SELE 2
SET EXCLU OFF
USE &DR&F2
CLEA
SELE 1
LOCATE FOR ENTR_PRINT=.F. .AND. .NOT. EOF()
IF .NOT. FOUND()
   SELE 2
   LOCATE FOR ENTR_PRINT=.F. .AND. .NOT. EOF()
   IF .NOT. FOUND()
      RETURN
   ENDIF
ENDIF
DO ADDRESSA
@  8,  5  SAY "B. ENTRY IN STORE"
@ 11,  5  SAY "PRINT ENTRY IN STORE"
@ 10,  3  TO 12, 26
@  7,  3  TO  9, 23    DOUBLE
KLR='N'
DO SET_DEV
IF KLR='Y'
   SET EXCLU OFF
   CLOSE DATA
   CLOSE INDEX
   RETURN
ENDIF
br=100
fl=0
hl=0
ttl=0
store 0 to ttl1,ttl2,ttl3,ttl4,ttl5
set devi to print
@ 0,0 say chr(15) pict 'x'
SELE 1
GO TOP
do while .not. eof()
   IF ENTRY_DATE<>DATE() .OR. ENTRY_ORDR=0
      SKIP
      LOOP
   ENDIF
   NOMOR=ENTRY_NBER
   if br>57
      if fl>0
         eject
      else
         fl=1
      endif
      cl=50
      hl=hl+1
      TITLE1=ALLTRIM(AEANAME)+' - '+ALLTRIM(AEACOUN)
      TITLE2=ALLTRIM(AEAADDR)
      @  0, 0 SAY TITLE1
      @  0,106 say 'DATE : '+DTOC(DATE())
      @  1, 0 SAY TITLE2
      @  1,106 say 'PAGE : '+ALLTRIM(STR(HL,2,0))
      @  2,0 SAY AEACITY
      @  2, 58 say 'ENTRY  STOCK'
      @  3, 58 SAY '------------'
      @  4,  0 say repl('=',122)
      @  5,  4 say 'ORDER'
      @  5, 11 say 'CODE'
      @  5, 18 say 'NAME'
      @  5, 40 say 'TYPE'
      @  5, 54 say 'CONTENT'
      @  5, 66 SAY 'UNIT'
      @  5, 80 SAY 'QUANTITY'
      @  5, 97 SAY 'UNIT PRICE'
      @  5,110 SAY 'TOTAL PRICE'
      @ 06,0 say repl('-',122)
      br=6
   endif
   br=br+1
   IF REC_LOCK(0)
      REPL ENTR_PRINT WITH .T.
   ENDIF
   UNLOCK
   @ BR,  6 SAY ENTRY_ORDR PICT '999'
   @ BR, 11 SAY DRUG_CODE
   @ BR, 18 SAY DRUG_NAME
   @ BR, 40 SAY DRUG_TYPE
   @ BR, 54 SAY DRUG_QANT
   @ BR, 60 SAY DRUG_UNIT
   @ BR, 66 SAY BUY_UNIT
   @ BR, 80 SAY ENT_QANT   PICT '9,999,999'
   DO SAYG WITH BR,97,ENT_PRICE,'99,999.99','9,999,999'
   DO SAYG WITH BR,110,ENT_AMOUNT,'99,999.99','9,999,999'
*   @ BR, 97 SAY ENT_PRICE  PICT '9,999,999'
*   @ BR,110 SAY ENT_AMOUNT PICT'999,999,999'
   TTL1=TTL1+ENT_AMOUNT
   SKIP
ENDDO
SELE 2
GO TOP
do while .not. eof()
   IF ENTRY_DATE<>DATE() .OR. ENTRY_ORDR=0
      SKIP
      LOOP
   ENDIF
   NOMOR=ENTRY_NBER
   if br>57
      if fl>0
         eject
      else
         fl=1
      endif
      cl=50
      hl=hl+1
      TITLE1=ALLTRIM(AEANAME)+' - '+ALLTRIM(AEACOUN)
      TITLE2=ALLTRIM(AEAADDR)
      @  0, 0 SAY TITLE1
      @  0,106 say 'DATE : '+DTOC(DATE())
      @  1, 0 SAY TITLE2
      @  1,106 say 'PAGE : '+ALLTRIM(STR(HL,2,0))
      @  2,0 SAY AEACITY
      @  2, 58 say 'ENTRY  STOCK'
      @  3, 58 SAY '------------'
      @  4,  0 say repl('=',122)
      @  5,  4 say 'ORDER'
      @  5, 11 say 'CODE'
      @  5, 18 say 'NAME'
      @  5, 40 say 'TYPE'
      @  5, 54 say 'CONTENT'
      @  5, 66 SAY 'UNIT'
      @  5, 81 SAY 'QANTITY'
      @  5, 97 SAY 'UNIT PRICE'
      @  5, 110 SAY 'TOTAL PRICE'
      @ 06,0 say repl('-',122)
      br=6
   endif
   br=br+1
   IF REC_LOCK(0)
      REPL ENTR_PRINT WITH .T.
   ENDIF
   UNLOCK
   @ BR,  6 SAY ENTRY_ORDR PICT '999'
   @ BR, 11 SAY DISP_CODE
   @ BR, 18 SAY DISP_NAME
   @ BR, 40 SAY DISP_TYPE
   @ BR, 54 SAY DISP_QANT
   @ BR, 60 SAY DISP_UNIT
   @ BR, 66 SAY BUY_UNIT
   @ BR, 80 SAY ENT_QANT   PICT '9,999,999'
   DO SAYG WITH BR,97,ENT_PRICE,'99,999.99','9,999,999'
   DO SAYG WITH BR,110,ENT_AMOUNT,'99,999.99','9,999,999'
**  @ BR, 97 SAY ENT_PRICE  PICT '9,999,999'
*   @ BR, 110 SAY ENT_AMOUNT PICT '999,999,999'
   TTL1=TTL1+ENT_AMOUNT
   SKIP
ENDDO
BR=BR+1
@ BR,110 SAY '-----------'
BR=BR+1
DO SAYG WITH BR,110,TTL1,'9,999,999.99','999,999,999'
*@ BR,110 SAY TTL1 PICT '999,999,999'
TTL1=0
BR=100
*EJECT
@ 0,0 SAY CHR(18) PICT 'X'
SET DEVI TO SCREEN
SET EXCLU OFF
CLOSE DATA
CLOSE INDEX
RETURN
*Formatted by: Herman T Ver. 7.1  on May 30, 1996.
